package com.hivekion.common.config;

import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.hivekion.common.handler.MetaHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisPlusConfig {
      /**
       * 分页插件
       *
       * @return
       */
      @Bean
      public PaginationInterceptor paginationInterceptor() {
	    return new PaginationInterceptor();
      }

      @Bean
      public GlobalConfig globalConfig() {
	    GlobalConfig globalConfig = new GlobalConfig();
	    globalConfig.setMetaObjectHandler(new MetaHandler());
	    return globalConfig;
      }

      //需要注入的Bean
      @Bean
      public EasySqlInjector easySqlInjector() {
	    return new EasySqlInjector();
      }

}
